package pers.course.week9;

import java.util.*;

public class AscendingOrder {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        Map<String, Integer> tm = new TreeMap<String, Integer>(
                new Comparator<String>() {
                    public int compare(String obj1, String obj2) {
                        // 降序排序
                        return obj2.compareTo(obj1);
                    }
                });
//        Map<String, Integer> tm = new TreeMap<>();
        String str = cin.nextLine();
        String[] strs = str.split(" ");
        strs[0] = strs[0].toLowerCase(Locale.ROOT);
        StringBuffer sb = new StringBuffer();
        for (String s : strs) {
            if (tm.containsKey(s)) {
                int count = tm.get(s) + 1;
                tm.put(s, count);
            } else {
                tm.put(s, 1);
            }
        }
        Set<String> st = tm.keySet();
        Iterator<String> iter = st.iterator();
        while (iter.hasNext()) {
            String ss = iter.next().toString();
            int count = tm.get(ss);
            sb.append(ss).append("=").append(count).append(", ");
        }
        System.out.println(sb.substring(0, (sb.length() - 2)));
    }
}
